const express=require('express')
const router=express.Router()
//导入用户路由处理函数对应的中间件
const loginHandler=require('../router_handler/login')
//导入验证数据中间件
const expressJoi=require('@escook/express-joi')
//导入验证规则对象
const {login_schema,schema}=require('../schema/user')
const verify=require('../emailverify/index')

router.post('/sendcode',expressJoi(schema),verify.sendcode)
router.post('/login',expressJoi(login_schema),loginHandler.login)
router.post('/resetpassword',expressJoi(login_schema),loginHandler.resetpassword)
router.post('/regUser',expressJoi(login_schema),loginHandler.regUser)
module.exports=router